{% extends 'king_admin_tmp/king_base.html' %}
{% load tags %}

{% block body %}

    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">Cnblog.yw.cn</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
            <li><a href="#">Dashboard</a></li>
            <li><a href="#">Settings</a></li>
            <li><a href="#">Profile</a></li>
            <li><a href="#">用户：{{ request.user }}</a></li>
          </ul>
          <form class="navbar-form navbar-right">
            <input type="text" class="form-control" placeholder="Search...">
          </form>
        </div>
      </div>
    </nav>

    {% block contenter %}

        <div class="row container-fluid jumbotron">




        {% for app_name ,table_names in table_list.items %}

            <div class="panel panel-primary">

                <div class="panel-heading">
                    <h5>{{ app_name }}</h5>
                </div>
                <div class="panel-body">
                    <table class="table table-hover">
                        <thead>
                            <tr><th class="panel-heading">{{ app_name }}</th></tr>
                        </thead>
                        <tbody>
                        {% for table_name ,admin in table_names.items %}
                            <tr>
                                <td><a href="{% url 'table_obj' app_name table_name %}">
                                    {% render_app_name admin %}
                                </a></td>
                                <td>Add</td>
                                <td>Change</td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        {% endfor %}




        </div>
    {% endblock %}


{% endblock %}